/*
 * @Author: 一路向阳 tt_sunzhenfeng@163.com
 * @Date: 2024-02-02 16:30:26
 * @LastEditors: 一路向阳 tt_sunzhenfeng@163.com
 * @LastEditTime: 2024-03-07 17:38:03
 * @FilePath: \utils_react_manager\app\src\store\Login\reducer.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import store from "./index";
import { ICommonAction } from '@/interface/store';


const loginReducer = function (state = {...store?.state}, action: ICommonAction) {
  for (const key in store.actionNames) {
    if (action?.type === store.actionNames[key]) {
      return store?.actions?.[store.actionNames[key]]?.(state, action);
    }
  }
  return state;
}

export default loginReducer;